/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package queenb.web.permission.store;

import java.sql.SQLException;
import java.util.List;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.Q050;
import queenb.web.util.PackageContants;
/**
 *
 * @author ems
 */
public class Q050Store extends Q050 {
    public int updateQ050(
            int pnFN100,
            int pnFH000,
            String pvLogin)  throws SQLException {

            DataStatement dataStatement = new DataStatement(PackageContants.UPDATE_Q050, OracleTypes.INTEGER, new Param[]
            {
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.CHAR, pvLogin)
            });

            return super.update(dataStatement, Q050.class);

    }


    public List<Q050> ListOfTabQ0050(
            int pnFH000,
            int pnFH200,
            String pvNV103,
            String pvLogin
            ) throws SQLException, InstantiationException, IllegalAccessException {
             DataStatement dataStatement = new DataStatement(PackageContants.LIST_Q050, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.CHAR, pvNV103),
                    new Param(OracleTypes.CHAR, pvLogin),
                });

            return super.find(dataStatement, Q050.class);

    }

        public int deleteQ050(
            int pnFN100,
            int pnFH000,
            String pvLOGIN)
            throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.DELETE_Q050, OracleTypes.INTEGER, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });
        return super.update(dataStatement, null);
    }
            public int updateColumnOfTable(String pvSCHEMA, String pvTABNAME, String pvCOLNAME, int pnVALUE, String pvPRIMARYKEY, int pnCONDITION, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.ORG_UPDATE_COL, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.CHAR, pvSCHEMA),
                        new Param(OracleTypes.CHAR, pvTABNAME),
                        new Param(OracleTypes.CHAR, pvCOLNAME),
                        new Param(OracleTypes.INTEGER, pnVALUE),
                        new Param(OracleTypes.CHAR, pvPRIMARYKEY),
                        new Param(OracleTypes.INTEGER, pnCONDITION),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.updateNoOutParam(dateStatement, Q050.class);
        } catch (SQLException ex) {
            System.out.println("error" + ex.getMessage());
            return 0;
        }

    }
}
